<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/resources/jstl_contexpath.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <title>虎丘婚纱城管理系统</title>
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/bs3/css/bootstrap.min.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/bootstrap-reset.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/font-awesome/css/font-awesome.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/clndr.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/style.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/css/style-responsive.css" />" />

    <!-- start: CSS -->
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/assets/css/bootstrap.min.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/assets/css/style.min.css" />" />
    <link rel="stylesheet" type="text/css" href="<c:url value="/resources/assets/css/retina.min.css" />" />
    <!-- end: CSS -->

    <!-- start: Favicon and Touch Icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="<c:url value="/resources/assets/ico/apple-touch-icon-144-precomposed.png" />" />
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="<c:url value="/resources/assets/ico/apple-touch-icon-114-precomposed.png" />" />
    <link rel="apple-touch-icon-precomposed" sizes="72x72" href="<c:url value="/resources/assets/ico/apple-touch-icon-72-precomposed.png" />" />
    <link rel="apple-touch-icon-precomposed" sizes="57x57" href="<c:url value="/resources/assets/ico/apple-touch-icon-57-precomposed.png" />" />
    <link rel="shortcut icon" href="<c:url value="/resources/assets/ico/favicon.png" />" />
    <!-- end: Favicon and Touch Icons -->

</head>
<body>

<!-- start: Header -->
<%@ include file="/resources/head.jsp" %>
<!-- end: Header -->

<div class="container">
    <div class="row">
        <!-- start: Main Menu -->
        <%@ include file="/resources/sidebar.jsp" %>
        <!-- end: Main Menu -->

        <!-- start: Content -->
        <div id="content" class="col-lg-10 col-sm-11">
            <div class="row">
                <div class="col-lg-12">
                    <div class="box">
                        <div class="box-header">
                            <h2><i class="fa fa-align-justify"></i><span class="break"></span>编辑</h2>
                            <div class="box-icon">
                            </div>
                        </div>
                        <div class="box-content">
                            <form class="form-horizontal">
                                <input type="hidden" name="edited_user_id" id="edited_user_id" value="${edited_user.user_id}" />
                                <div class="form-group has-success">
                                    <label class="control-label" >登录名</label>
                                    <input type="text" class="form-control" id="login_name" name="login_name" value="${edited_user.login_name}" readonly />
                                </div>
                                <div class="form-group has-success">
                                    <label class="control-label" >密码</label>
                                    <input type="password" class="form-control" id="login_pwd" name="login_pwd" value="${edited_user.login_pwd}" readonly />
                                </div>
                                <div class="form-group has-success">
                                    <label class="control-label" >用户姓名</label>
                                    <input type="text" class="form-control" id="user_name" name="user_name" value="${edited_user.user_name}" />
                                </div>
                                <div class="form-group has-success">
                                    <label class="control-label" >工号</label>
                                    <input type="text" class="form-control" id="employee_id" name="employee_id" value="${edited_user.employee_id}" />
                                </div>
                                <div class="form-group has-success">
                                    <label class="control-label" >昵称</label>
                                    <input type="text" class="form-control" id="nice_name" name="nick_name" value="${edited_user.nick_name}" />
                                </div>
                                <div class="form-actions">
                                    <button type="button" class="btn btn-primary" id="save">保存</button>
                                    <button type="button" class="btn" id="cancel">取消</button>
                                </div>

                            </form>
                        </div>
                    </div>
                </div><!--/col-->
            </div>
        </div>
    </div>
</div>
<%@ include file="/resources/managerfoot.jsp"%>

<!-- start: JavaScript-->
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery-2.1.0.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery-migrate-1.2.1.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/bootstrap.min.js" />" ></script>

<!-- page scripts -->
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery-ui-1.10.3.custom.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery.sparkline.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/jquery.dataTables.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/dataTables.bootstrap.min.js" />" ></script>

<!-- theme scripts -->
<script type="text/javascript" src="<c:url value="/resources/assets/js/custom.min.js" />" ></script>
<script type="text/javascript" src="<c:url value="/resources/assets/js/core.min.js" />" ></script>

<!-- inline scripts related to this page -->
<script type="text/javascript" src="<c:url value="/resources/assets/js/pages/table.js" />" ></script>

<!-- end: JavaScript-->

<script>
    $(function () {
        $('#cancel').click(function(){
            window.location.href="${ctx}/manage/system/user/index";
        });
        $('#save').click(function(){
            var edited_user_id = $('#edited_user_id').val();
            var user_name = $('#user_name').val();
            var employee_id = $.trim($('#employee_id').val());
            var nice_name = $.trim($('#nice_name').val());
            $.ajax({
                type:'POST',
                url:'${ctx}/manage/system/user/doedit',
                data:{edited_user_id:edited_user_id,user_name:user_name,employee_id:employee_id,nice_name:nice_name},
                dataType:'text',
                success: function(data){
                    if(data == 1) {
                        alert("成功！");
                    } else {
                        alert("失败！");
                    }
                }
            });
        })
    });
</script>
</body>
</html>